package test_achieve.web.scenes;

import constant.Pm;
import cucumber.api.java.en.Given;
import test_achieve.web.AverageUser;
import test_achieve.web.Oneself;
import test_achieve.web.OrderMain;

/**
 * Created by chenkuo on 2017/10/23.
 */
public class SendReceivePay {
    /**寄付、到付的场景封装*/

    /**前置：无
     * 步骤：登录，切成城市，寄付详情，下单*/

    @Given("^w用户下了一个一取一投的寄付订单"+ Pm.p11)
    public void w用户下了一个一取一投的寄付订单(String username,String city,String sendAdress,String sendName,String sendMobile,String receiveAddress,String receiveName,String receiveMobile,String weight,String goodsName,String remark) throws Throwable {
        OneToOne oneToOne = new OneToOne();
        oneToOne.w登录并输入一取一投类型订单的详细信息( username, city, sendAdress, sendName, sendMobile, receiveAddress, receiveName, receiveMobile, weight, goodsName, remark);
        OrderMain webmain = new OrderMain();
        webmain.wClickNext();
        AverageUser aveuser = new AverageUser();
        aveuser.w取消余额支付();
        aveuser.w选择寄付下单();
        aveuser.获取并输入寄付短信验证码(username,sendMobile);
        webmain.wSubmitOrder();
        webmain.w确认订单提交成功();
    }
    @Given("^w用户下了一个一取一投的寄付订单"+Pm.p5)
    public void w用户下了一个一取一投的寄付订单(String username,String sendAdress,String sendMobile,String receiveAddress,String goodsName) throws Throwable {
        w用户下了一个一取一投的寄付订单( username, null, sendAdress, null, sendMobile, receiveAddress, null, null, null, goodsName, null);
    }

    /**前置：无
     * 步骤：登录，切成城市，到付详情，下单*/

    @Given("^w用户下了一个一取一投的到付订单"+Pm.p11)
    public void w用户下了一个一取一投的到付订单(String username,String city,String sendAdress,String sendName,String sendMobile,String receiveAddress,String receiveName,String receiveMobile,String weight,String goodsName,String remark) throws Throwable {
        OneToOne oneToOne = new OneToOne();
        oneToOne.w登录并输入一取一投类型订单的详细信息( username, city, sendAdress, sendName, sendMobile, receiveAddress, receiveName, receiveMobile, weight, goodsName, remark);
        OrderMain webmain = new OrderMain();
        webmain.wClickNext();
        AverageUser aveuser = new AverageUser();
        aveuser.w取消余额支付();
        aveuser.选择到付下单();
        aveuser.获取并输入寄付短信验证码(username,sendMobile);
        webmain.wSubmitOrder();
//        webmain.w进入我的闪送中();
//        aveuser.w今日订单中判断订单为到付();
    }
    @Given("^w用户下了一个一取一投的到付订单"+Pm.p5)
    public void w用户下了一个一取一投的到付订单(String username,String sendAdress,String sendMobile,String receiveAddress,String goodsName) throws Throwable {
        w用户下了一个一取一投的到付订单( username, null, sendAdress, null, sendMobile, receiveAddress, null, null, null, goodsName, null);

    }

    @Given("^w用户登录状态下了一个一取一投的寄付订单"+Pm.p3)
    public void w用户登录状态下了一个一取一投的到付订单(String sendAdress,String sendMobile,String receiveAddress) throws Throwable {
        Oneself oneself = new Oneself();
        oneself.w进入在线下单界面();
        OneToOne oneToOne = new OneToOne();
        oneToOne.w输入一取一投订单信息( sendAdress,null, sendMobile, receiveAddress, null, null, null, null, null);
        OrderMain webmain = new OrderMain();
        webmain.wClickNext();
        AverageUser aveuser = new AverageUser();
        aveuser.w取消余额支付();
        aveuser.w选择寄付下单();
        webmain.wSubmitOrder();
        webmain.w确认订单提交成功();
    }

}
